package edu.ubb.scrumster.model.model;

public class Estimation implements AbstractModel {
	int id;
	User user;
	Task task;
	int time;
	int priority;

	public Estimation(User user, Task task, int time, int priority) {
		super();
		this.user = user;
		this.task = task;
		this.time = time;
		this.priority = priority;
	}

	public Estimation(int id, User user, Task task, int time, int priority) {
		super();
		this.id = id;
		this.user = user;
		this.task = task;
		this.time = time;
		this.priority = priority;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}
	
	public void validate() throws ModelException{
		if (this.time==0){
			throw new ModelException("Time is 0.");
		}
		if (this.priority==0){
			throw new ModelException("Priority is 0.");
		}
	}

}
